package com.neusoft.controller.physician;

import com.neusoft.service.DisposalRequestService;
import com.neusoft.service.InspectionRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.Map;

@RestController
@RequestMapping("/disposalrequests")
//@CrossOrigin
public class DisposalRequestController2 {
    @Autowired
    private DisposalRequestService disposalRequestService;

    @PostMapping("/saveDisposalRequest")
    public String saveDisposalRequest(@RequestBody Map<String,Object> disposalRequest){

        disposalRequest.put("creation_time", LocalDateTime.now());
        return disposalRequestService.saveInspectionRequest(disposalRequest);
    }
}
